import request from '@/config/axios'

// 产品完成工序 VO
export interface ProductProcessCompletedVO {
  id: number // 主键ID
  orderId: string // 订单ID
  internalCode: string // 内码
  productionCode: string // 成品码
  type: string // 规格型号
  lastCollectionTime: Date // 最后一次集采时间
  deptId: string // 课室ID
  deptName: string // 课室名称
  deptId: string // 当前所在部门ID
  deliveryStatus: string // 拨交状态
  deliveryFinishTime: Date // 拨交完成时间
  remark: string // 备注
}

// 产品完成工序 API
export const ProductProcessCompletedApi = {
  // 查询产品完成工序分页
  getProductProcessCompletedPage: async (params: any) => {
    return await request.get({ url: `/project/product-process-completed/page`, params })
  },

  // 查询产品完成工序详情
  getProductProcessCompleted: async (id: number) => {
    return await request.get({ url: `/project/product-process-completed/get?id=` + id })
  },

  // 新增产品完成工序
  createProductProcessCompleted: async (data: ProductProcessCompletedVO) => {
    return await request.post({ url: `/project/product-process-completed/create`, data })
  },

  // 修改产品完成工序
  updateProductProcessCompleted: async (data: ProductProcessCompletedVO) => {
    return await request.put({ url: `/project/product-process-completed/update`, data })
  },

  // 删除产品完成工序
  deleteProductProcessCompleted: async (id: number) => {
    return await request.delete({ url: `/project/product-process-completed/delete?id=` + id })
  },

  // 导出产品完成工序 Excel
  exportProductProcessCompleted: async (params) => {
    return await request.download({ url: `/project/product-process-completed/export-excel`, params })
  }
}
